<?php
/**
 * @file
 * @package mileage
 * @version $Id$
**/

if (!defined('XOOPS_ROOT_PATH')) {
	exit;
}

require_once XOOPS_ROOT_PATH . '/core/XCube_PageNavigator.class.php';

/**
 * Mileage_AbstractListAction
**/
abstract class Mileage_AbstractListAction extends Mileage_AbstractAction
{
	/**
	 * @brief   XoopsSimpleObject[]
	**/
	public $mObjects = null;

	/**
	 * @brief   Mileage_AbstractFilterForm
	**/
	public $mFilter = null;

	/**
	 * &_getHandler
	 * 
	 * @param   void
	 * 
	 * @return  &XoopsObjectGenericHandler
	**/
	protected function &_getHandler()
	{
	}

	/**
	 * &_getFilterForm
	 * 
	 * @param   void
	 * 
	 * @return  &MileageAbstractFilterForm
	**/
	protected function &_getFilterForm()
	{
	}

	/**
	 * _getBaseUrl
	 * 
	 * @param   void
	 * 
	 * @return  string
	**/
	protected function _getBaseUrl()
	{
	}

	/**
	 * &_getPageNavi
	 * 
	 * @param   void
	 * 
	 * @return  &XCube_PageNavigator
	**/
	protected function &_getPageNavi()
	{
		$navi = new XCube_PageNavigator($this->_getBaseUrl(), XCUBE_PAGENAVI_START);
		return $navi;
	}

	/**
	 * getDefaultView
	 * 
	 * @param   void
	 * 
	 * @return  Enum
	**/
	public function getDefaultView()
	{
		$this->mFilter =& $this->_getFilterForm();
		$this->mFilter->fetch();

		$handler =& $this->_getHandler();
		$this->mObjects =& $handler->getObjects($this->mFilter->getCriteria());

		return MILEAGE_FRAME_VIEW_INDEX;
	}

	/**
	 * execute
	 * 
	 * @param   void
	 * 
	 * @return  Enum
	**/
	public function execute()
	{
		return $this->getDefaultView();
	}
}

